package com.diors.game.example.main;

import com.diors.commons.log.DiorsLogger;
import com.diors.commons.thread.ThreadUncaughtExceptionHandler;
import com.diors.game.example.network.NetWorkInit;
import com.diors.game.example.server.GameServerInit;

/**
 * 例子Main类
 * @author	darren.ouyang
 * @data	2013-9-9
 */
public class CoreMain 
{
	private static final DiorsLogger log = DiorsLogger.getLogger(CoreMain.class);
	
	/**
	 * 启动方法
	 * @param args
	 * @create	2013-9-9	darren.ouyang
	 */
	public static void main(String[] args) throws Exception 
	{
		DiorsLogger.configure("./log/log4j.properties");
		
		log.info("<========================= 服务器开始启动 =========================>");
		
		//设置线程由于未捕获到异常而突然终止时调用的默认处理程序。
		Thread.setDefaultUncaughtExceptionHandler(new ThreadUncaughtExceptionHandler());
		
		/* 游戏业务初始化 */
		GameServerInit.getInstrance().init();
		
		/* 网络层初始化 */
		NetWorkInit.getInstrance().init();
		
		log.info("<========================= 服务器完成启动 =========================>");
	}
	
}
